package main

import (
	"fmt"
	"github.com/gin-gonic/gin"
)

func main() {
	r := gin.Default()
	r.POST("/post", func(context *gin.Context) {
		//从请求中获取
		id := context.Query("id")
		//从请求路径中获取,可以给默认值
		page := context.DefaultQuery("page", "0")
		//从post form表单中获取
		name := context.PostForm("name")
		message := context.PostForm("message")
		fmt.Printf("id: %s; page: %s; name: %s; message: %s\n", id, page, name, message)

	})
	r.Run()
}
